import java.util.*;

public class charFrequency{
  
  int store = 0;
  int j = 0, length = 0, value = 0;
  char c = ' ';
  int temp;
  int[] text = new int[200];
  int[] data = new int[200];
  Stack stack = new Stack();
  
  //Input the desired file intro the class's constructor
  public charFrequency(String str) {
    CharReader read = new CharReader(str);
    Sorting sort = new Sorting();
 
    //Stores the ASCII value of the character being read into an array.
    for(int i = 0; store != -1; i++) {
      store = read.readNextChar();
      text[i] = store;
    }
    read.closeFile();
    
    //Sorts the array
    sort.quickSort(text);
  }
  
  //Stores the different ASCII values intro their own array and pushes the arrays into the stack
  public void search() {

    for(int i = 0; i < text.length; i++) {
      int j = i;
      temp = text[i];
      while(temp == text[j]) { 
        data[i] = text[i];
        j += 1;
      }
      data[i] = text[i];
      stack.push(data);
      data = new int[text.length - i];
    }
  }
}